package com.learn

object lesson08 {

  abstract class Person{
    def sayHello()=println("hello")

  }

  def show(p:Person)=p.sayHello()

  def main(args: Array[String]): Unit = {
    println("hhh")

    new Person {
      override def sayHello(): Unit = println("hello scala")
    }.sayHello()

    val p:Person=new Person {
      override def sayHello(): Unit = println("匿名函数调用的")
    }
    show(p)



  }
}
